/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fwdisp.settings;

import java.awt.Color;

/**
 *
 * @author rbs
 */
public class Setting {

    private SettingsID id;
    private Object value;

    public class WrongTypException extends Exception{

        public WrongTypException() {
            super();
        }

    }

    public Setting(SettingsID id, Object value) {
        this.id = id;
        this.value = value;

    }

    public void setValue(Object value)
    {
        this.value = value;
    }

    public Color getColor() throws WrongTypException
    {
        if (id != SettingsID.COLOR)
            throw new WrongTypException();
        return (Color) value;
    }

    public Integer getInteger() throws WrongTypException
    {
        if (id != SettingsID.INT)
            throw new WrongTypException();
        return (Integer) value;
    }

    public String getString() throws WrongTypException
    {
        if (id != SettingsID.STRING)
            throw new WrongTypException();
        return (String) value;
    }


}
